/*
 * Copyright 2024 Harness, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

.treeList {
  list-style: none;
  margin: 0;
  padding: 0;
}

.treeNodeCollapseContainer {
  border: none;
}

.headingContent {
  flex: 1;
}

.actionElement {
  display: none;
  &.alwaysShowAction {
    display: block;
  }
}

.treeNode {
  display: flex;
  align-items: center;

  & > :first-child {
    padding-left: var(--spacing-large) !important;
    padding-right: var(--spacing-small) !important;
  }

  & .header {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-xsmall);
  }

  &:hover,
  &:focus,
  &:active,
  &.active {
    background-color: var(--primary-2);
    cursor: pointer;

    & .actionElement {
      display: block;
    }
  }

  &.disabled {
    cursor: auto;
    &:hover {
      background-color: var(--grey-100);
    }
  }

  & .levelImg {
    width: var(--spacing-large);
    align-self: stretch;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
  }
}

.treeNodeContent {
  .labelContainer {
    flex: 1;
    margin-left: var(--spacing-small) !important;
  }
}

.stickyNode {
  position: sticky;
  top: 0;
  background-color: var(--white);
}
